package com.tpc.control.jpa;

import java.util.Date;
import java.util.List;
import java.util.Set;

/**
 * Interface for SaleDataDAO.
 * 
 * @author MyEclipse Persistence Tools
 */

public interface ISaleDataDAO {
	/**
	 * Perform an initial save of a previously unsaved SaleData entity. All
	 * subsequent persist actions of this entity should use the #update()
	 * method. This operation must be performed within the a database
	 * transaction context for the entity's data to be permanently saved to the
	 * persistence store, i.e., database. This method uses the
	 * {@link javax.persistence.EntityManager#persist(Object)
	 * EntityManager#persist} operation.
	 * 
	 * <pre>
	 * EntityManagerHelper.beginTransaction();
	 * ISaleDataDAO.save(entity);
	 * EntityManagerHelper.commit();
	 * </pre>
	 * 
	 * @param entity
	 *            SaleData entity to persist
	 * @throws RuntimeException
	 *             when the operation fails
	 */
	public void save(SaleData entity);

	/**
	 * Delete a persistent SaleData entity. This operation must be performed
	 * within the a database transaction context for the entity's data to be
	 * permanently deleted from the persistence store, i.e., database. This
	 * method uses the {@link javax.persistence.EntityManager#remove(Object)
	 * EntityManager#delete} operation.
	 * 
	 * <pre>
	 * EntityManagerHelper.beginTransaction();
	 * ISaleDataDAO.delete(entity);
	 * EntityManagerHelper.commit();
	 * entity = null;
	 * </pre>
	 * 
	 * @param entity
	 *            SaleData entity to delete
	 * @throws RuntimeException
	 *             when the operation fails
	 */
	public void delete(SaleData entity);

	/**
	 * Persist a previously saved SaleData entity and return it or a copy of it
	 * to the sender. A copy of the SaleData entity parameter is returned when
	 * the JPA persistence mechanism has not previously been tracking the
	 * updated entity. This operation must be performed within the a database
	 * transaction context for the entity's data to be permanently saved to the
	 * persistence store, i.e., database. This method uses the
	 * {@link javax.persistence.EntityManager#merge(Object) EntityManager#merge}
	 * operation.
	 * 
	 * <pre>
	 * EntityManagerHelper.beginTransaction();
	 * entity = ISaleDataDAO.update(entity);
	 * EntityManagerHelper.commit();
	 * </pre>
	 * 
	 * @param entity
	 *            SaleData entity to update
	 * @return SaleData the persisted SaleData entity instance, may not be the
	 *         same
	 * @throws RuntimeException
	 *             if the operation fails
	 */
	public SaleData update(SaleData entity);

	public SaleData findById(SaleDataId id);

	/**
	 * Find all SaleData entities with a specific property value.
	 * 
	 * @param propertyName
	 *            the name of the SaleData property to query
	 * @param value
	 *            the property value to match
	 * @return List<SaleData> found by query
	 */
	public List<SaleData> findByProperty(String propertyName, Object value);

	public List<SaleData> findByCustomer(Object customer);

	public List<SaleData> findByCustomerName(Object customerName);

	public List<SaleData> findByCustomerPoNo(Object customerPoNo);

	public List<SaleData> findBySaleOrg(Object saleOrg);

	public List<SaleData> findByDistrChannel(Object distrChannel);

	public List<SaleData> findByPlant(Object plant);

	public List<SaleData> findByMaterial(Object material);

	public List<SaleData> findByOrderAmount(Object orderAmount);

	public List<SaleData> findByCompleteAmount(Object completeAmount);

	public List<SaleData> findByRemainAmount(Object remainAmount);

	public List<SaleData> findByEndUserCode(Object endUserCode);

	public List<SaleData> findByEndUserName(Object endUserName);

	public List<SaleData> findByCompleteFlag(Object completeFlag);

	public List<SaleData> findByQuantity(Object quantity);

	public List<SaleData> findByUom(Object uom);

	public List<SaleData> findByPrice(Object price);

	public List<SaleData> findByCurrency(Object currency);

	/**
	 * Find all SaleData entities.
	 * 
	 * @return List<SaleData> all SaleData entities
	 */
	public List<SaleData> findAll();
}